<template>
  <div class="header">
    <div class="box">
      <div class="logo">
        <img src="/static/img/logo.png">
      </div>
      <ul>
        <li :class="pageIndex == '1'?'selected':''" @click="jump('/', '1')">首页</li>
        <li :class="pageIndex == '2'?'selected':''" @click="jump('/about', '2')">关于我们</li>
        <li :class="pageIndex == '3'?'selected':''">新闻动态</li>
        <li :class="pageIndex == '4'?'selected':''" @click="jump('/work', '4')">作品展示</li>
        <li :class="pageIndex == '5'?'selected':''">服务项目</li>
        <li :class="pageIndex == '6'?'selected':''">经典客户</li>
        <li :class="pageIndex == '7'?'selected':''">联系我们</li>
      </ul>
    </div>
  </div>
</template>
<script>
export default {
  name: 'header',
  data () {
    return {
      pageIndex: '1'
    }
  },
  methods: {
    jump: function (src, index) {
      this.$router.push(src)
      this.pageIndex = index
    }
  }
}
</script>
<style scoped>
.header{
  width: 100%;
  height: 12vh;
  background-color: #0E1012;
  user-select: none;
}
.box{
  position: relative;
  margin: 0 auto;
  height: 12vh;
}
.box *{
  float: left;
}
.logo{
  transition: all .25s;
}
.logo img{
  width: 100%;
}
ul {
  position: absolute;
  right: 0;
}
li{
  list-style: none;
  font-size: 16px;
  color: #b6b6b6;
  cursor: pointer;
}
.selected{
  font-weight: bold;
  color: #FFF;
}
@media screen and (min-width: 800px){
  .box{
    width: 70%;
    min-width: 800px;
  }
  .logo{
    width: 25vh;
    height: 8vh;
    margin-top: 2vh;
  }
  ul{
    margin-top: 5vh;
  }
  li{
    margin-left: 25px;
  }
}

@media screen and (max-width: 800px){
  .box{
    max-width: 95%;
  }
  .box * {
    float: none;
  }
  .logo{
    margin: 0 auto;
    position: relative;
    top: 12px;
    /*left: -60px;*/
    width: 30vh;
    height: 9vh;
  }
  ul{
    display: none;
  }
}
</style>
